package com.jiwei.system.dao;

import com.jiwei.system.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @title: MemberMapper
 * @Author 赖志宇
 * @Description TODO
 * @Date: 2020/8/18
 * @Version 1.0
 */
@Mapper
public interface MemberMapper {

    Member queryMemberByAccount(String account);

    void update(Member member);

    List<Member> queryAllMember();

    List<Member> queryMemberByRole(@Param(value = "start") int start, @Param(value = "limit") int limit, @Param(value = "role") String role);

    @Select("select count(*) from member_info ")
    int queryAllMemberNum();

    @Select("select count(*) from member_login where role =#{role} ")
    int queryMemberNumByRole(String role);

    void resetPassword(@Param(value = "account") String account, @Param(value = "Pwd") String Pwd);

    void deleteMember(String account);

    void changeMemberRole(@Param(value = "account") String account, @Param(value = "role") String role);

    @Select("select account from member_login where account =#{account}")
    String memberIsExist(String account);

    void addMemberInfo(Member member);


}
